class Score {
    score = 0
    level = 1
    scorenum:number
    maxlevel:number
    scorehtml:HTMLElement
    levelhtml:HTMLElement

    constructor(scorenum:number = 10,maxlevel:number = 10){
        this.scorehtml = document.getElementById('sco')!
        this.levelhtml = document.getElementById('level')!
        this.scorenum = scorenum
        this.maxlevel = maxlevel
    }

    scoreUp(){
        this.scorehtml.innerHTML = ++this.score + ''
        if(this.score % this.scorenum === 0){
            this.levelUp()
        }
    }

    levelUp(){
        if(this.level<this.maxlevel){
            this.levelhtml.innerHTML = ++this.level + ''
        }
        
    }
}

export default Score